import { createRouter, createWebHistory } from "vue-router";
import Login from "../views/Login.vue";
import Home from "../views/Home.vue";

const routes = [
  {
    path: "/login",
    name: "Login",
    component: Login,
  },
  {
    path: "/",
    name: "Home",
    component: Home,
    children: [
      {
        path: "/source",
        name: "DataSource",
        component: () => import("@/views/system/datasource/index.vue"),
      },
      {
        path: "/process",
        name: "DataProcessing",
        component: () => import("@/views/system/dataprocessing/index.vue"),
      },
      {
        path: "/analysis",
        name: "DataAnalysis",
        component: () => import("@/views/system/dataanalysis/index.vue"),
      },
      {
        path: "/visualization",
        name: "DataVisual",
        component: () => import("@/views/system/datavisual/index.vue"),
      },
      {
        path: "/archive",
        name: "DataArchiving",
        component: () => import("@/views/system/dataarchive/index.vue"),
      },
      {
        path: "/operlog",
        name: "OperLog",
        component: () => import("@/views/monitor/operlog/index.vue"),
      },
      {
        path: "/logininfor",
        name: "LoginInfor",
        component: () => import("@/views/monitor/logininfor/index.vue"),
      },
    ],
  },
];

const router = createRouter({
  history: createWebHistory(),
  routes,
});

export default router;
